package com.inspur.cloud.service.ambari;

import com.inspur.cloud.dao.ambari.ClustersDao;
import com.inspur.cloud.entity.ambari.ClustersEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClustersService {
    @Autowired
    private ClustersDao clustersDao;

    public List<ClustersEntity> findAll() {
        return clustersDao.findAll();
    }

    public String findClusterName() {
        List<ClustersEntity> list = findAll();
        if (list.size() > 0) {
            return list.get(0).getClusterName();
        } else {
            return null;
        }
    }
}
